import { http } from "@/utils/http";
import type { HttpResult } from "@/utils/http/types";

export function queryDeptTable(params) {
  return http.request<HttpResult>("get", "/admin/department/get/table", {
    params: params
  });
}

export function queryDeptList(params) {
  return http.request<HttpResult>("get", "/admin/department/get/list", {
    params: params
  });
}

export function queryDeptTree(params) {
  return http.request<HttpResult>("get", "/admin/department/get/tree", {
    params: params
  });
}

export function queryDeptJsonTree(params) {
  return http.request<HttpResult>("get", "/admin/department/get/treejson", {
    params: params
  });
}

export function deleteDept(ids) {
  return http.request<HttpResult>("post", `/admin/department/delete/${ids}`);
}

export function addDept(params) {
  return http.request<HttpResult>("post", "/admin/department/insert", {
    data: params
  });
}

export function updateDept(params) {
  return http.request<HttpResult>("post", "/admin/department/update", {
    data: params
  });
}
